{include file="common/_header-css"}
{include file="common/_jQuery"}
<body>
<div class="x-nav">
      <span class="layui-breadcrumb">
        <a href="#">首页</a>
        <a href="#">常规设置</a>
        <a>
          <cite>系统设置</cite></a>
      </span>
    <a class="layui-btn layui-btn-small" style="line-height:1.6em;margin-top:3px;float:right" onclick="location.reload()" title="刷新">
        <i class="layui-icon layui-icon-refresh" style="line-height:30px"></i></a>
</div>
<div class="layui-fluid">
    <div class="layui-row layui-col-space15">

        <!--    文字配置项 -系统配置   -->
        <div class="layui-col-md12">
            <div class="layui-card">
                <div class="layui-card-header">系统设置</div>
                <div class="layui-card-body">
                    <form class="layui-form layui-col-space5">
                        {volist name='list' id='vo'}
                        {if $vo.group == 1}
                        <div class="layui-form-item">
                            <label class="layui-form-label">{$vo.title}</label>
                            <div class="layui-input-block">
                                <input type="text" name="config[{$vo.id}]" required  lay-verify="required" placeholder="请输入{$vo.title}"
                                       autocomplete="off" class="layui-input" value="{$vo.value}">
                            </div>
                        </div>
                        {/if}
                        {/volist}
                        <div class="layui-form-item">
                            <div class="layui-input-block">
                                <button class="layui-btn" lay-submit lay-filter="config_from_text_btn">保存</button>
                                <button type="reset" class="layui-btn layui-btn-primary">重置</button>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>

        <div class="layui-col-md12">
            <div class="layui-card">
                <div class="layui-card-header">微信小程序配置</div>
                <div class="layui-card-body">
                    <form class="layui-form layui-col-space5">
                        {volist name='list' id='vo'}
                        {if $vo.group == 2}
                        <div class="layui-form-item">
                            <label class="layui-form-label">{$vo.title}</label>
                            <div class="layui-input-block">
                                <input type="text" name="config[{$vo.id}]" required  lay-verify="required" placeholder="请输入{$vo.title}"
                                       autocomplete="off" class="layui-input" value="{$vo.value}">
                            </div>
                        </div>
                        {/if}
                        {/volist}
                        <div class="layui-form-item">
                            <div class="layui-input-block">
                                <button class="layui-btn" lay-submit lay-filter="config_from_text_btn">保存</button>
                                <button type="reset" class="layui-btn layui-btn-primary">重置</button>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>

    </div>
</div>
</body>
<script>
    layui.use('form', function(){
        var form = layui.form;
        form.on('submit(config_from_text_btn)', function(data){
           $.post("{:url('config/system_settings')}",data.field,function (res) {
               // console.log(res);
               if (res.code == 200) {
                   layer.msg(res.msg,{icon:6,time:500});
               }else{
                   layer.msg(res.msg,{icon:5,time:1000});
               }
           });
            return false;
        });
    });
</script>
</html>